package com.bjsxt.collection;

import java.util.LinkedList;
import java.util.List;

public class LinkListTest {
    public static void main(String[] args) {
        List<String> list = new LinkedList<>();
        list.add("a");
        list.add("b");
        list.add("c");
        list.add("c");
        System.out.println(list.get(2));

        LinkedList<String> linkedList = new LinkedList<>();
        linkedList.add("a");
        linkedList.add("g");
        linkedList.add("g");
        linkedList.add("b");
        System.out.println(linkedList);
        linkedList.addFirst("q");
        linkedList.addLast("q");
        System.out.println(linkedList);
        System.out.println(linkedList.pop());
        linkedList.push("s");
        System.out.println(linkedList);

    }
}
